<template>
	<view class="result">
		
		<view class="result-box">
			<view class="result-title">
				<view class="nav-icon"></view>
				疾病种类
			</view>
			<view class="result-textarea">
				<u--textarea autoHeight disabled disabledColor="#f2f2f2" v-html="result.illnessTypeName"></u--textarea>
			</view>
		</view>
		
		<view class="result-box">
			<view class="result-title">
				<view class="nav-icon"></view>
				诊断结果及治疗方案
			</view>
			<view class="result-textarea">
				<u--textarea autoHeight disabled disabledColor="#f2f2f2" v-html="result.diagnosisAndTreatment"></u--textarea>
			</view>
		</view>
		
		<view class="result-box">
			<view class="result-title">
				<view class="nav-icon"></view>
				建议用药
			</view>


			<view v-for="(item,index) in result.diagnosticResultMedicalArr" :key="index">
				<view class="result-input">
					药名 <u--input disabled disabledColor="#f2f2f2" v-html="item.name"></u--input>
				</view>

				<view class="result-input">
					用药途径:
					<u--input disabled style="width: 30%;" disabledColor="#f2f2f2" v-html="item.useWay===1?'口服':item.useWay===2?'静滴':'静推'"></u--input>
				</view>

				<view class="result-input">
					用药时间:
					<u--input style="width: 30%;" disabled disabledColor="#f2f2f2" v-html="item.time"></u--input>
					用药量:
					<u--input style="width: 45%;" disabled disabledColor="#f2f2f2" v-html="item.num"></u--input>
				</view>
			</view>


		</view>
		<view class="result-box">
			<view class="result-title">
				<view class="nav-icon"></view>
				观察意外事项
			</view>
			<view class="result-textarea">
				<u--textarea autoHeight disabled disabledColor="#f2f2f2" v-html="result.observeContingencies"></u--textarea>
			</view>
		</view>
		<view class="result-box">
			<view class="result-title">
				<view class="nav-icon"></view>
				意外状况处理建议
			</view>
			<view class="result-textarea">
				<u--textarea autoHeight disabled disabledColor="#f2f2f2" v-html="result.contingencyHandlingAdvice"></u--textarea>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				result: {}
			};
		},
		onLoad(option) {
			this.getDiagnosticResult(option.id)
		},
		methods: {
			//获取诊断结果
			async getDiagnosticResult(id) {
				const {
					data
				} = await uni.$http.post('/patient-interrogationRecords/getDiagnosticResult?id=' + id)
				if (data.code === 200) {
					this.result = data.data
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.result {
		overflow: auto;
		width: 100%;
		height: 100%;
		background-color: #f2f2f2;
		padding: 20rpx;
		box-sizing: border-box;

		.result-box {
			margin-bottom: 20rpx;
			width: 100%;
			background-color: #fff;
			border-radius: 20rpx;
			padding: 20rpx;
			box-sizing: border-box;

			.result-title {
				display: flex;
				align-items: center;
				color: #54b6ab;

				.nav-icon {
					width: 10rpx;
					height: 30rpx;
					background-color: #54b6ab;
					margin-right: 20rpx;
				}
			}

			.result-textarea {
				margin-top: 20rpx;
				width: 100%;
				background-color: #f2f2f2;
				border-radius: 10rpx;

				/deep/.u-textarea {
					background-color: transparent;
					border: none;

					.uni-textarea-placeholder {
						font-size: 22rpx;
					}
				}
			}

			.result-input {
				margin-top: 20rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				background-color: #f2f2f2;
				border-radius: 10rpx;
				width: 100%;

				/deep/.u-input {
					background-color: #f2f2f2;
					border: none;

					.uni-input-placeholder {
						font-size: 22rpx;
					}
				}
			}
		}
	}
</style>